package com.knight.concurrent.chapter10;

/**
 * @Description:
 * @author: knight
 * @Date: 2019-03-10 16:05
 */
public class SingletonObject {

    private static volatile SingletonObject instance = null;


    private SingletonObject() {
    }

    public SingletonObject getInstance() {
        if (null == instance) {
            synchronized (SingletonObject.class) {
                if (null == instance) {
                    instance = new SingletonObject();
                }
            }
        }
        return instance;
    }

}
